#!c:\python25\python.exe

# $Id: rst2html.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.

"""
A minimal front end to the Docutils Publisher, producing HTML body only.
"""

try:
    import locale
    locale.setlocale(locale.LC_ALL, '')
except:
    pass

from docutils.core import publish_parts, default_description

# The `pygments_code_block_directive`_ module defines and registers a new
# directive `code-block` that uses the `pygments`_ source highlighter to
# render code in color::

import pygments_code_block_directive

description = ('Generates (X)HTML documents from standalone reStructuredText '
               'sources.  ' + default_description)

def main():
    parts = publish_parts(open('testblog.txt').read(),
        writer_name='html',
        settings_overrides={
            'template': 'template.txt',
            'stylesheet': 'http://kupuguy.googlepages.com/stylesheet.css',
            'stylesheet_path': None,
            'link-stylesheet': True,
            'embed_stylesheet': False,
        },
    )
    print "Meta=", parts['meta']
    print "Title=", parts['title']
    print "Stylesheet=", parts['stylesheet']
    print "Docinfo", parts['docinfo']
    print "Body", parts['body']
    

if __name__=='__main__':
    main()

